
import bpy

from 节点.全局控制.Node.插座 import bl_插座基类

from 节点.Core import bl_UI配色
from 节点.全局控制.Node.节点数据类型 import bl_集合数据类型






class C_Socket_图像(bl_插座基类.C_Socket_基类):
	bl_label = '纹理集'
	bl_icon = 'FILE_IMAGE'
	#m_Value = bpy.props.PointerProperty(type=bpy.types.Image)
	m_Value = bpy.props.PointerProperty(type=bpy.types.Texture)
	def __init__(self):
		super(C_Socket_图像, self).__init__()
	
	def draw_color(self, context, node):
		return bl_UI配色.g_物体插座颜色
	def f_getData(self):
		return self.m_Value
	def f_setData(self, data):
		self.m_Value = data


class C_Socket_图像_Array1D(bl_插座基类.C_Socket_基类):
	bl_label = '纹理集 Array1D'
	bl_icon = 'FILE_IMAGE'
	m_Value = bpy.props.PointerProperty(type=bpy.types.Texture)
	def __init__(self):
		super(C_Socket_图像_Array1D, self).__init__()

	def draw_color(self, context, node):
		return bl_UI配色.g_物体插座颜色
	def f_getData(self):
		return self.m_Value
	def f_setData(self, data):
		pass
		#self.m_Value = data








class C_Socket_纹理(bl_插座基类.C_Socket_基类):
	bl_label = '纹理'
	bl_icon = 'FILE_IMAGE'
	m_Value = bpy.props.PointerProperty(type=bpy.types.Image)
	def __init__(self):
		super(C_Socket_纹理, self).__init__()

	def draw_color(self, context, node):
		return bl_UI配色.g_物体插座颜色


class C_Socket_纹理_Array1D(bl_插座基类.C_Socket_基类):
	bl_label = '纹理集'
	bl_icon = 'FILE_IMAGE'
	m_Value = bpy.props.CollectionProperty(type=bl_集合数据类型.C_纹理数据)
	def __init__(self):
		super(C_Socket_纹理_Array1D, self).__init__()

	def draw_color(self, context, node):
		return bl_UI配色.g_物体插座颜色












'''class C_Socket_像素(插座基类.C_Socket_基类):
	default_value = bpy.props.FloatVectorProperty(size=4, default=(0.0,0.0,0.0,1.0), update=f_socketVecList_Update)
	def __init__(self):
		super(C_Socket_Vec2_Array1D, self).__init__()
	def draw(self, context, layout, node, text):
		if self.is_output == False and self.is_linked == False :
			layout.prop( self, 'default_value', text=text )
		else:
			layout.label(text=text+":[vec2]")
	def draw_color(self, context, node):
		return 配色.g_矢量插座颜色_Array
	def f_getData(self):
		return engineLib.flexCAPI.f_取插座数据(ctypes.c_wchar_p(self.node.id_data.name), ctypes.c_wchar_p(self.node.name), ctypes.c_wchar_p(self.identifier))
	def f_setData(self, data):
		pass
	def f_update(self):
		f_socketVecList_Update(self, None)'''







classes = (
	C_Socket_图像,
	#C_Socket_图像_Array1D,
	
	C_Socket_纹理,
	#C_Socket_纹理_Array1D,
	
)

def register():
	for c in classes:
		bpy.utils.register_class(c)
	pass	

def unregister():
	for c in classes:
		bpy.utils.unregister_class(c)
	pass



